package in.googydiary.service.test;

import java.util.ArrayList;
import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.codehaus.jettison.json.JSONException;
import org.codehaus.jettison.json.JSONObject;

@Path("/hello")
public class HelloResource {

	@GET
	@Produces(MediaType.APPLICATION_JSON)
	public JSONObject sayHello() {
		List<Activity> list = new ArrayList<Activity>();

		Activity act = new Activity();
		act.setId(1);
		act.setActivityName("a");
		list.add(act);

		act.setId(2);
		act.setActivityName("b");
		list.add(act);

		act.setId(3);
		act.setActivityName("c");
		list.add(act);
		
		JSONObject outputJsonObj = new JSONObject();  
	    try {
			outputJsonObj.put("output", list);
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}  
	  
	    return outputJsonObj;
	}
}